<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>libspotify: sp_session_callbacks Struct Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">libspotify
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">sp_session_callbacks Struct Reference<div class="ingroups"><a class="el" href="group__session.html">Session handling</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;api.h&gt;</code></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a52d509962541f7d8fdd71284f40d8415"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a52d509962541f7d8fdd71284f40d8415">logged_in</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td></tr>
<tr class="memitem:a073231e9ceb3d40f4a772ab64ba4ece7"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a073231e9ceb3d40f4a772ab64ba4ece7">logged_out</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:a09912988f00ea5e90835681b382a18fc"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a09912988f00ea5e90835681b382a18fc">metadata_updated</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:a45bf5d3fac7953099a191ea39fcfc018"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a45bf5d3fac7953099a191ea39fcfc018">connection_error</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td></tr>
<tr class="memitem:ae5d6e4a9a4296cfcbca1e57acdb4d64d"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#ae5d6e4a9a4296cfcbca1e57acdb4d64d">message_to_user</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const char *message)</td></tr>
<tr class="memitem:a085cfd82e77aee2b592f314321019a29"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a085cfd82e77aee2b592f314321019a29">notify_main_thread</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:a33a31478b8de1882ad7847ad033fbaeb"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a33a31478b8de1882ad7847ad033fbaeb">music_delivery</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const <a class="el" href="structsp__audioformat.html">sp_audioformat</a> *format, const void *frames, int num_frames)</td></tr>
<tr class="memitem:a641fc97950305fbcd83d5114918c53b9"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a641fc97950305fbcd83d5114918c53b9">play_token_lost</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:aae0ce9c91f2779fafa40ebd640060a05"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#aae0ce9c91f2779fafa40ebd640060a05">log_message</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const char *data)</td></tr>
<tr class="memitem:a6bc198d89ff46d930c32dae950bd0294"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a6bc198d89ff46d930c32dae950bd0294">end_of_track</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:a003db54ec10236a3e3d77bfbf31f38ae"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a003db54ec10236a3e3d77bfbf31f38ae">streaming_error</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td></tr>
<tr class="memitem:a8685310c1755044ec0ea0e316de8be6e"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a8685310c1755044ec0ea0e316de8be6e">userinfo_updated</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:adcfcee6abf1b6f408010e5615d2a79c8"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#adcfcee6abf1b6f408010e5615d2a79c8">start_playback</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:a2a225bc017266c935c05d18142f27ad6"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a2a225bc017266c935c05d18142f27ad6">stop_playback</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:a328404ac150210387ea3f9cc973149c9"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#a328404ac150210387ea3f9cc973149c9">get_audio_buffer_stats</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="structsp__audio__buffer__stats.html">sp_audio_buffer_stats</a> *stats)</td></tr>
<tr class="memitem:aa0f62ed875aab47e5ae093576a6d54c8"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#aa0f62ed875aab47e5ae093576a6d54c8">offline_status_updated</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td></tr>
<tr class="memitem:ad403ac063f5512b277c924add75dfbea"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#ad403ac063f5512b277c924add75dfbea">offline_error</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td></tr>
<tr class="memitem:ae7c5c209735f5c437d76a512eebbf30b"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsp__session__callbacks.html#ae7c5c209735f5c437d76a512eebbf30b">credentials_blob_updated</a> )(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const char *blob)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Session callbacks</p>
<p>Registered when you create a session. If some callbacks should not be of interest, set them to NULL. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="jukebox_8c-example.html#_a23">jukebox.c</a>.</dd>
</dl></div><hr/><h2>Field Documentation</h2>
<a class="anchor" id="a45bf5d3fac7953099a191ea39fcfc018"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a45bf5d3fac7953099a191ea39fcfc018">sp_session_callbacks::connection_error</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when there is a connection error, and the library has problems reconnecting to the Spotify service. Could be called multiple times (as long as the problem is present)</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error</td><td>One of the following errors, from <a class="el" href="group__error.html#ga83154178d3a32668658734d2facfa22b">sp_error</a> SP_ERROR_OK SP_ERROR_CLIENT_TOO_OLD SP_ERROR_UNABLE_TO_CONTACT_SERVER SP_ERROR_BAD_USERNAME_OR_PASSWORD SP_ERROR_USER_BANNED SP_ERROR_USER_NEEDS_PREMIUM SP_ERROR_OTHER_TRANSIENT SP_ERROR_OTHER_PERMANENT </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae7c5c209735f5c437d76a512eebbf30b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#ae7c5c209735f5c437d76a512eebbf30b">sp_session_callbacks::credentials_blob_updated</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const char *blob)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when storable credentials have been updated, usually called when we have connected to the AP.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">blob</td><td>Blob is a null-terminated string which contains an encrypted token that can be stored safely on disk instead of storing plaintext passwords. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6bc198d89ff46d930c32dae950bd0294"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a6bc198d89ff46d930c32dae950bd0294">sp_session_callbacks::end_of_track</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>End of track. Called when the currently played track has reached its end.</p>
<dl class="section note"><dt>Note:</dt><dd>This function is invoked from the main thread</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a328404ac150210387ea3f9cc973149c9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a328404ac150210387ea3f9cc973149c9">sp_session_callbacks::get_audio_buffer_stats</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="structsp__audio__buffer__stats.html">sp_audio_buffer_stats</a> *stats)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called to query application about its audio buffer</p>
<dl class="section note"><dt>Note:</dt><dd>This function is called from an internal session thread - you need to have proper synchronization!</dd>
<dd>
This function must never block.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">stats</td><td>Stats struct to be filled by application </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aae0ce9c91f2779fafa40ebd640060a05"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#aae0ce9c91f2779fafa40ebd640060a05">sp_session_callbacks::log_message</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const char *data)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Logging callback.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Log data </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a52d509962541f7d8fdd71284f40d8415"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a52d509962541f7d8fdd71284f40d8415">sp_session_callbacks::logged_in</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when login has been processed and was successful</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error</td><td>One of the following errors, from <a class="el" href="group__error.html#ga83154178d3a32668658734d2facfa22b">sp_error</a> SP_ERROR_OK SP_ERROR_CLIENT_TOO_OLD SP_ERROR_UNABLE_TO_CONTACT_SERVER SP_ERROR_BAD_USERNAME_OR_PASSWORD SP_ERROR_USER_BANNED SP_ERROR_USER_NEEDS_PREMIUM SP_ERROR_OTHER_TRANSIENT SP_ERROR_OTHER_PERMANENT </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="jukebox_8c-example.html#a24">jukebox.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a073231e9ceb3d40f4a772ab64ba4ece7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a073231e9ceb3d40f4a772ab64ba4ece7">sp_session_callbacks::logged_out</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when logout has been processed. Either called explicitly if you initialize a logout operation, or implicitly if there is a permanent connection error</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae5d6e4a9a4296cfcbca1e57acdb4d64d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#ae5d6e4a9a4296cfcbca1e57acdb4d64d">sp_session_callbacks::message_to_user</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const char *message)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when the access point wants to display a message to the user</p>
<p>In the desktop client, these are shown in a blueish toolbar just below the search box.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">message</td><td>String in UTF-8 format. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a09912988f00ea5e90835681b382a18fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a09912988f00ea5e90835681b382a18fc">sp_session_callbacks::metadata_updated</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called whenever metadata has been updated</p>
<p>If you have metadata cached outside of libspotify, you should purge your caches and fetch new versions.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a33a31478b8de1882ad7847ad033fbaeb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int( * <a class="el" href="structsp__session__callbacks.html#a33a31478b8de1882ad7847ad033fbaeb">sp_session_callbacks::music_delivery</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, const <a class="el" href="structsp__audioformat.html">sp_audioformat</a> *format, const void *frames, int num_frames)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when there is decompressed audio data available.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">format</td><td>Audio format descriptor <a class="el" href="structsp__audioformat.html">sp_audioformat</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">frames</td><td>Points to raw PCM data as described by <code>format</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">num_frames</td><td>Number of available samples in <code>frames</code>. If this is 0, a discontinuity has occurred (such as after a seek). The application should flush its audio fifos, etc.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Number of frames consumed. This value can be used to rate limit the output from the library if your output buffers are saturated. The library will retry delivery in about 100ms.</dd></dl>
<dl class="section note"><dt>Note:</dt><dd>This function is called from an internal session thread - you need to have proper synchronization!</dd>
<dd>
This function must never block. If your output buffers are full you must return 0 to signal that the library should retry delivery in a short while. </dd></dl>

</div>
</div>
<a class="anchor" id="a085cfd82e77aee2b592f314321019a29"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a085cfd82e77aee2b592f314321019a29">sp_session_callbacks::notify_main_thread</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when processing needs to take place on the main thread.</p>
<p>You need to call <a class="el" href="group__session.html#ga019a640b351de2a1ffe040ed755013f4">sp_session_process_events()</a> in the main thread to get libspotify to do more work. Failure to do so may cause request timeouts, or a lost connection.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note:</dt><dd>This function is called from an internal session thread - you need to have proper synchronization! </dd></dl>

</div>
</div>
<a class="anchor" id="ad403ac063f5512b277c924add75dfbea"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#ad403ac063f5512b277c924add75dfbea">sp_session_callbacks::offline_error</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when offline synchronization status is updated</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error</td><td>Offline error. Will be SP_ERROR_OK if the offline synchronization error state has cleared </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa0f62ed875aab47e5ae093576a6d54c8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#aa0f62ed875aab47e5ae093576a6d54c8">sp_session_callbacks::offline_status_updated</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when offline synchronization status is updated</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a641fc97950305fbcd83d5114918c53b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a641fc97950305fbcd83d5114918c53b9">sp_session_callbacks::play_token_lost</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Music has been paused because an account only allows music to be played from one location simultaneously.</p>
<dl class="section note"><dt>Note:</dt><dd>When this callback is invoked the application should behave just as if the user pressed the pause button. The application should also display a message to the user indicating the playback has been paused because another application is playing using the same account.</dd>
<dd>
IT MUST NOT automatically resume playback but must instead wait for the user to press play.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adcfcee6abf1b6f408010e5615d2a79c8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#adcfcee6abf1b6f408010e5615d2a79c8">sp_session_callbacks::start_playback</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when audio playback should start</p>
<dl class="section note"><dt>Note:</dt><dd>For this to work correctly the application must also implement <a class="el" href="structsp__session__callbacks.html#a328404ac150210387ea3f9cc973149c9">get_audio_buffer_stats()</a></dd>
<dd>
This function is called from an internal session thread - you need to have proper synchronization!</dd>
<dd>
This function must never block.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2a225bc017266c935c05d18142f27ad6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a2a225bc017266c935c05d18142f27ad6">sp_session_callbacks::stop_playback</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called when audio playback should stop</p>
<dl class="section note"><dt>Note:</dt><dd>For this to work correctly the application must also implement <a class="el" href="structsp__session__callbacks.html#a328404ac150210387ea3f9cc973149c9">get_audio_buffer_stats()</a></dd>
<dd>
This function is called from an internal session thread - you need to have proper synchronization!</dd>
<dd>
This function must never block.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a003db54ec10236a3e3d77bfbf31f38ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a003db54ec10236a3e3d77bfbf31f38ae">sp_session_callbacks::streaming_error</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session, <a class="el" href="group__error.html#gafd27986ce4cd9eeaeca8adda83c9eb6b">sp_error</a> error)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Streaming error. Called when streaming cannot start or continue.</p>
<dl class="section note"><dt>Note:</dt><dd>This function is invoked from the main thread</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">error</td><td>One of the following errors, from <a class="el" href="group__error.html#ga83154178d3a32668658734d2facfa22b">sp_error</a> SP_ERROR_NO_STREAM_AVAILABLE SP_ERROR_OTHER_TRANSIENT SP_ERROR_OTHER_PERMANENT </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8685310c1755044ec0ea0e316de8be6e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * <a class="el" href="structsp__session__callbacks.html#a8685310c1755044ec0ea0e316de8be6e">sp_session_callbacks::userinfo_updated</a>)(<a class="el" href="group__types.html#ga70dd19c6f824cf6a159575aa4c128b53">sp_session</a> *session)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Called after user info (anything related to sp_user objects) have been updated.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">session</td><td>Session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="api_8h.html">api.h</a></li>
</ul>
</div><!-- contents -->
<hr size="1"><address style="text-align: right;"><small>
Generated on Wed Mar 28 2012 18:22:23.<br>
Copyright &copy; 2006&ndash;2012 Spotify Ltd</small></address>
</body>
</html>
